<?php
session_start();
if(!$_SESSION['logged_in']) {
	header("Location: /login");	
}
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/database.php');
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/functions.php');
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/class.admin.php');

ob_start("sanitize_output"); 
$admin=new admin();
$nav=$admin->getAdminNavigation();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Administration.</title>
<link rel="stylesheet" href="/admin/resources/client/bundle.css" />

<script src="/admin/resources/client/bundle.js" type="text/javascript"></script>
<?php 
if(USE_GOOGLE_MAPS) {
echo('<script src="http://maps.google.com/maps/api/js?key='.GOOGLE_MAPS_KEY.'&sensor=false"></script>
');	
}

?>
<script>
	$(document).ready(function(){
		$("#list-site-settings").click();
	
	});
</script>
</head>

<body>
<div id="header">
	<ul>
    	<?php
			foreach($nav as $row) {
		
			?>	
		<li class="menu-item"><a id="<?php echo($row['id']); ?>" href="<?php echo($row['href']); ?>" class="ajax admin-menu cb"><?php echo($row['label']); ?></a><?php if(is_array($row['children'])) { ?><ul class="menu-sub" style="display:none;"><?php foreach($row['children'] as $child) { 
		echo('<li><a href="'.$child['href'].'" class="ajax msuba">'.$child['label'].'</a></li>');
		
		} ?></ul><?php } ?></li>	
				
		<?php	
            }
		?>
        
       
    </ul>
</div>
<div id="content">
</div>

<div class="clearfix"></div>
<div id="response" style="display:none;"></div>
</body>
</html>